<template>
	<el-card style="height: 100%;">
		<div id="a1">
			<el-button @click="st()">添加试题 </el-button>
			<div id="a2">
				<el-table
				  :data="tableData"
				  border
				  >
				  <el-table-column
				    prop="name"
				    label="试题类型"
				    >
				  </el-table-column>
				  <el-table-column    
				    prop="timu"
				    label="试题题目">
				  </el-table-column>
					
					
				  <el-table-column
				    prop="type"
				    label="答案"
				    >
				  </el-table-column>
				 
				  <el-table-column
				    fixed="right"
				    label="操作"
				    >
				    <template slot-scope="scope">
				      <el-button @click="deletea(scope.row)" type="text" size="small">删除</el-button>
				      <el-button type="text" size="small" @click="bj">编辑</el-button>
					
				    </template>
				  </el-table-column>
				</el-table>
			</div>
		</div>
	</el-card>
</template>

<script>
	export default{
		data() {
			return {
				shijuanid:'',
				tableData:[],
				
			}
		},
		methods:{
			bj(){
				
			},
			st(){
				this.$router.push('/exam/index?shijuanid='+this.shijuanid)
			},
			deletea(row) {
					  this.$ajax.post('Shijuan/delete',{"id":row.id}).then(res=>{
						  if(res.data.success){
							  this.getList()
						  }
						  })
			      },
			getList(){
				  this.shijuanid=this.$route.query.row
				  console.log(this.shijuanid);
				  	this.$ajax.post('Shijuan/findQuestion',{"shijuanid":this.shijuanid}).then(res=>{
				  	  var result=res.data;
				  	  this.tableData=result.data;
				  	  console.log(this.tableData);
				  	})
				  
			  }
			},
			created() {

				this.getList()
			}
		
	}
</script>
<!-- deletea(row) {
		  this.$ajax.post('Shijuan/delete',{"id":row.id}).then(res=>{
			  if(res.data.success){
				  this.getList()
			  }
			  })
      },
	  add(){
		  this.$router.replace('/teacher/sjbianji')
	  },
	  bj(){
		  this.$router.replace('/teacher/bj')
	  },
	  tjst(row){
		  this.$router.push('/exam/mainst')
	  },
	 -->
<style>
</style>
